#pragma once
#include "basegameentity.h"
#include "statemachine.h"
#include "locations.h"
#include "entitymanager.h"

class GoldMine : public BaseGameEntity 
{
public:

	// Class Constructor
	GoldMine(int iID);

	// Class Destructor
	~GoldMine();

	// Virtual Initialize
	bool						Initialize();

	// Virtual Update Function
	void						Update(float fDt);

	// Draw Sprite
	void						Draw();

	// Return the amount of gold mine is currently holding
	int							GoldSupply() const{return m_iGoldSupply;}

	// Return the amount of gold mine can hold
	int							MaxGoldCapacity() const{return m_iMaxGoldCapacity;}

	// Getters
	StateMachine<GoldMine>*		GetFSM()const {return m_pStateMachine;}
	bool						HandleMessage(const Telegram& message){return m_pStateMachine->HandleMessage(message);}

	// Remove Gold from Mine
	void						RemoveGold(int iGold){m_iGoldSupply -= iGold;}

	// Return true if Mine is empty
	bool						IsGoldMineEmpty();

private:
	// Pointer to State Machine
	StateMachine<GoldMine>*		m_pStateMachine;

	// Amount of gold gold mine is holding
	int							m_iGoldSupply;	

	// Amount of gold the mine can hold
	int							m_iMaxGoldCapacity;
};